package com.dabbo.starship.player;

import java.rmi.RemoteException;

import com.dabbo.starship.interfaces.CellLocationInterface;
import com.dabbo.starship.interfaces.Player;
import com.dabbo.starship.shared.CellLocation;

public class PlayerUnit extends java.rmi.server.UnicastRemoteObject implements Player {

	private static final long serialVersionUID = -4803683198056541687L;

	protected String 				playerName;
	protected int					containerID;
	protected int					roomID;
	protected CellLocationInterface location;
	protected int					credits;
	protected int					health;
	protected boolean				activeStatus;
	protected String				commandCode;
	protected String				username;
	protected String				password;
	
	public PlayerUnit(String username) throws RemoteException {
		super();
		playerName 		= "Capt. Nobody";
		containerID 	= 0;
		roomID 			= 0;
		location 		= new CellLocation(0,0);
		credits 		= 0;
		health 			= 100;
		activeStatus 	= true;
		commandCode 	= "";
		this.username	= username;
		password		= "";
	}

	@Override
	public String getPlayerName() throws RemoteException {
		return this.playerName;
	}
	@Override
	public void setPlayerName(String playerName) throws RemoteException {
		this.playerName = playerName;
	}

	@Override
	public int getContainerID() throws RemoteException {
		return this.containerID;
	}
	@Override
	public void setContainerID(int containerID) throws RemoteException {
		this.containerID = containerID;
	}

	@Override
	public int getRoomID() throws RemoteException {
		return this.roomID;
	}
	@Override
	public void setRoomID(int roomID) throws RemoteException {
		this.roomID = roomID;
	}

	@Override
	public CellLocationInterface getLocation() throws RemoteException {
		return this.location;
	}
	@Override
	public void setLocation(CellLocationInterface location) throws RemoteException {
		this.location = location;
	}

	@Override
	public int getCredits() throws RemoteException {
		return this.credits;
	}
	@Override
	public void setCredits(int credits) throws RemoteException {
		this.credits = credits;		
	}

	@Override
	public int getHealth() throws RemoteException {
		return this.health;
	}
	@Override
	public void setHealth(int health) throws RemoteException {
		this.health = health;
	}

	@Override
	public boolean getActiveStatus() throws RemoteException {
		return this.activeStatus;
	}
	@Override
	public void setActiveStatus(boolean activeStatus) throws RemoteException {
		this.activeStatus = activeStatus;
	}
	
	@Override
	public String getCommandCode() throws RemoteException {
		return this.commandCode;
	}
	@Override
	public void setCommandCode(String commandCode) throws RemoteException {
		this.commandCode = commandCode;
	}

	@Override
	public int getCoX() throws RemoteException {
		return location.getCoX();
	}
	@Override
	public int getCoY() throws RemoteException {
		return location.getCoY();
	}

	@Override
	public void setCoX(int coX) throws RemoteException {
		this.location.setCoX(coX);
	}
	@Override
	public void setCoY(int coY) throws RemoteException {
		this.location.setCoY(coY);
	}

	@Override
	public String getUsername() throws RemoteException {
		return this.username;
	}

	@Override
	public void setUsername(String username) throws RemoteException {
		this.username = username;
	}

	@Override
	public String getPassword() throws RemoteException {
		return this.password;
	}

	@Override
	public void setPassword(String password) throws RemoteException {
		this.password = password;
	}

}
